package armserver.server;

public class ArmException extends Exception{

	public ArmException()
	{
		super();
	}
	public ArmException(String msg)
	{
		super(msg);
	}
	
	public ArmException(Throwable e)
	{
		super(e);
	}
	
	public ArmException(Throwable cause,String msg)
	{
	     super(msg,cause);
	}
	
	public Throwable getUnderlyingException()
	{
		return super.getCause();
	}
	
	public String toString()
	{
		Throwable cause = this.getUnderlyingException();
		if(cause==null|cause==this)
		{
			return super.toString();
		}
		else
		{
			return super.toString()+" [See nested Exception"+cause+"]";
		}
	}
}
